package com.example.filter;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;

import java.io.IOException;

//@WebFilter(urlPatterns = "/*")
public class XbcFilter implements Filter {

    //init与destroy已经默认执行不需要重写
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("执行放行前逻辑AbcFilter——Before");
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("执行放行后逻辑AbcFilter——After");
    }

}
